package demo2;

import java.util.Collection;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 87111
 * Date: 2025-06-24
 * Time: 10:03
 */
public class InnerClassExercise01 {
    public static void main(String[] args) {
        Cellphone cellphone = new Cellphone();
        cellphone.test();
    }
}

interface Bell {
    void ring();
}
class Cellphone {
    public void alarmClock(Bell bell) {
        bell.ring();
    }
    public void test() {
        alarmClock(new Bell() {
            public void ring() {
                System.out.println("懒猪起床了");
            }
        });
        alarmClock(new Bell() {
            public void ring() {
                System.out.println("小伙伴上课了");
            }
        });
    }
}
